package strategy

import "utilx/logx"

type EvictionAlgo interface {
	evict(c *Cache)
}
type Fifo struct {
}

func (l *Fifo) evict(c *Cache) {
	logx.Warn("Evicting by fifo strtegy")
	for s := range c.storage {
		delete(c.storage, s)
		return
	}
}

type Lru struct {
}

func (l *Lru) evict(c *Cache) {
	logx.Debug("Evicting by lru strtegy")
	for s := range c.storage {
		delete(c.storage, s)
		return
	}

}

type Lfu struct {
}

func (l *Lfu) evict(c *Cache) {
	logx.Error("Evicting by lfu strtegy")
	for s := range c.storage {
		delete(c.storage, s)
		return
	}

}
